<?php
namespace app\serversetting\validate;
use \app\manage\validate\BaseValidate;

class SettingCategory extends BaseValidate
{
    
	protected $rule =   [
		'app_id'  => ['integer','gt'=>0],
        'id'=>['integer','gt'=>0],
        'pid'=>['integer','egt'=>0],
        'action'=>['min'=>2],
        'name'=>['length'=>'2,25'],
        'order'=>['integer','gt'=>0],
        'status'=> ['in'=>'0,1']
    ];

    protected $message  =   [
        'id' => 'id大于0',
        'app_id' => 'app_id大于0',
        'pid' => 'pid大于等于0',
        'name' => '分类名称的长度在2-25个字符之间',
        'order' => 'order大于0',
        'status' => '选择启用或禁用',
    ];

    protected $scene = [
        'addCategory' => ['app_id','app_key','pid','name','action','order'],
        'editCategory' => [
            'app_id','id','pid','name','order'
        ],
        'oneCateInfo' => [
            'app_id','id',
        ],
        'delOneCate' => [
            'app_id', 'id',
        ],
        'batchDelCate' => [
            'id' => ['array','min'=>1],'app_id',
        ],
        'changeStatus' => [
            'id','app_id','status'
        ],
        'batchChangeStatus' => [
            'id' => ['array','min'=>1],'app_id','status'
        ],
        'getTree' => [
            'id'=>['integer','egt'=>0],
        ],

    ];

}